package com.ghxxzx.dagl.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ghxxzx.dagl.entity.Menue;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface MenueMapper extends BaseMapper<Menue> {
    @Select("SELECT * FROM `menue`")
    List<Menue> findAll();

    @Select("SELECT menue.`name` FROM menue WHERE menue.id in (select DISTINCT role_menue.menue_id from role_menue WHERE role_menue.role_id in (#{ids}))")
    List<String> findRoleNameMenueId(@Param("ids") Integer ids);
}
